import request from '@/libs/req';

const api = {
  nonce: 'user/get/nonce',
  login: 'user/login',
  info: 'index/index',
  bindPre: 'user/bindPre',
  record: 'index/record',
  extract: 'index/extract',
  saveOrder: 'account/save/recharge/order',
  rechargeState: 'account/update/recharge/state',
}

// 获取随机数
export const getNonce = (param) => {
  return request.post(api.nonce, param)
}

// 登录
export const goLogin = (param) => {
  return request.post(api.login, param)
}

// 获取首页数据
export const getInfo = () => {
  return request.post(api.info)
}

// 获取首页数据
export const bindPre = (param) => {
  return request.post(api.bindPre, param)
}

// 获取收益记录
export const getRecord = (param) => {
  return request.post(api.record, param)
}

// 提现收益
export const extract = (param) => {
  return request.post(api.extract, param)
}

// 创建充值订单
export const setSaveOrder = (param) => {
  return request.post(api.saveOrder, param)
}

// 修改订单状态
export const setRechargeState = (param) => {
  return request.post(api.rechargeState, param)
}